<!DOCTYPE html>
<html>

  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<meta http-equiv="Cache-Control" content="no-siteapp" />

    <title>xmake v2.5.3 Released, Support to build Linux bpf program and integrate Conda packages</title>
    <meta name="description" content="xmake is a lightweight cross-platform build tool based on Lua. It uses xmake.lua to maintain project builds. Compared with makefile/CMakeLists.txt, the confi...">

    
    <meta name="keywords" content="xmake,lua,C/C++,toolchains,bpf,conda,linux,tboox" /> 

    <!-- qq oauth -->
    <meta property="qc:admins" content="5211601217706727767255" />

    <!--icon -->
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
    <link rel="icon" sizes="192x192" href="/static/img/nice-highres.png" />
	<link rel="apple-touch-icon-precomposed" href="/static/img/apple-touch-icon-57x57-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/static/img/apple-touch-icon-72x72-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/static/img/apple-touch-icon-114x114-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/static/img/apple-touch-icon-144x144-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="180x180" href="/static/img/retinahd_icon.png" />
	<meta name="msapplication-TileImage" content="/static/img/retinahd_icon.png" />
	
    <link rel="stylesheet" href=" /css/fontawesome/css/font-awesome.min.css ">
    <link rel="stylesheet" href=" /css/main.css ">
    <link rel="canonical" href="https://tboox.org/2021/04/08/xmake-update-v2.5.3/">
    <link rel="alternate" type="application/rss+xml" title="TBOOX Open Source Project" href="https://tboox.org/feed.xml ">
    <link rel="alternate" hreflang="en" href="https://tboox.org/" />
    <link rel="alternate" hreflang="zh-Hans" href="https://tboox.org/cn/" />




    <script type="text/javascript">
    function isPC(){    
        var userAgentInfo = navigator.userAgent;  
        var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");    
        var flag = true;    
        for (var v = 0; v < Agents.length; v++) {    
            if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = false; break; }    
        }    
        return flag;    
    }
    </script>

<!-- baidu ads -->



    <!-- baidu ads -->

</head>


  <body>

    <header id="top">
    <div class="wrapper">
        <a href="/" class="brand">TBOOX</a>
        <button id="headerMenu" class="menu"><i class="fa fa-bars"></i></button>
        <nav id="headerNav">
            <ul>
                <li>
                    
                    <a href="/cn?lang=0">
                    
                        <i class="fa fa-home"></i>中文
                    </a>
                </li>

                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/project/">
                            
                        
                            <i class="fa fa-bookmark"></i>Projects
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/archive/">
                            
                        
                            <i class="fa fa-archive"></i>Archives
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/category/">
                            
                        
                            <i class="fa fa-th-list"></i>Categories
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/tag/">
                            
                        
                            <i class="fa fa-tags"></i>Tags
                        </a>
                    </li>
                    
                    
                    
                
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/docs/">
                            
                        
                            <i class="fa fa-book"></i>Documents
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="https://xmake.io/#/about/contact" target="_blank" >
                            
                        
                            <i class="fa fa-forumbee"></i>Community
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/donation/">
                            
                        
                            <i class="fa fa-heart"></i>Donate
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/about/">
                            
                        
                            <i class="fa fa-user"></i>About
                        </a>
                    </li>
                    
                    
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                     
                     
                    
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            </ul>
        </nav>
    </div>
</header>



        <div class="page clearfix" post>
    <div class="left">
        <h1>xmake v2.5.3 Released, Support to build Linux bpf program and integrate Conda packages</h1>
        <div class="label">

            <div class="label-card">
                <i class="fa fa-calendar"></i>2021-04-08
            </div>

            <div class="label-card">
                
            </div>

            <div class="label-card">
                
            </div>

            <div class="label-card">
            


<!-- <span class="point">•</span> -->
<span class="categories">
  <i class="fa fa-th-list"></i>
  
    
        <a href="/category/#xmake" title="Category: xmake" rel="category">xmake</a>
    
  

  <!-- <span class="point">•</span> -->
</span>


            </div>

            <div class="label-card">
            
<!-- <span class="point">•</span> -->
<span class="pageTag">
  <i class="fa fa-tags"></i>
  
    
        <!--a href="/tag/#xmake" title="Tag: xmake" rel="tag">xmake</a-->
        <a href="/tag/#xmake" title="Tag: xmake" rel="tag">xmake</a>&nbsp;
    
        <!--a href="/tag/#lua" title="Tag: lua" rel="tag">lua</a-->
        <a href="/tag/#lua" title="Tag: lua" rel="tag">lua</a>&nbsp;
    
        <!--a href="/tag/#C%2FC%2B%2B" title="Tag: C/C++" rel="tag">C/C++</a-->
        <a href="/tag/#C/C++" title="Tag: C/C++" rel="tag">C/C++</a>&nbsp;
    
        <!--a href="/tag/#toolchains" title="Tag: toolchains" rel="tag">toolchains</a-->
        <a href="/tag/#toolchains" title="Tag: toolchains" rel="tag">toolchains</a>&nbsp;
    
        <!--a href="/tag/#bpf" title="Tag: bpf" rel="tag">bpf</a-->
        <a href="/tag/#bpf" title="Tag: bpf" rel="tag">bpf</a>&nbsp;
    
        <!--a href="/tag/#conda" title="Tag: conda" rel="tag">conda</a-->
        <a href="/tag/#conda" title="Tag: conda" rel="tag">conda</a>&nbsp;
    
        <!--a href="/tag/#linux" title="Tag: linux" rel="tag">linux</a-->
        <a href="/tag/#linux" title="Tag: linux" rel="tag">linux</a>
    
  

</span>

            </div>

        </div>
        <hr>
        <article itemscope itemtype="http://schema.org/BlogPosting">
        <p><a href="https://github.com/xmake-io/xmake">xmake</a> is a lightweight cross-platform build tool based on Lua. It uses xmake.lua to maintain project builds. Compared with makefile/CMakeLists.txt, the configuration syntax is more Concise and intuitive, it is very friendly to novices, and you can get started quickly in a short time, allowing users to focus more on actual project development.</p>

<p>In version 2.5.3, we have been able to build linux and android bpf programs.</p>

<p>Although bpf has certain requirements for the compilation toolchain, such as the newer llvm/clang and android ndk toolchains, xmake can automatically pull a specific version of llvm/ndk for compilation, and it can also automatically pull libbpf dependencies. Library.</p>

<p>In addition, in the new version we have added support for the integration of C/C++ packages from Conda.</p>

<ul>
  <li><a href="https://github.com/xmake-io/xmake">Github</a></li>
  <li><a href="https://xmake.io/">Document</a></li>
</ul>

<h2 id="new-feature-introduction">New feature introduction</h2>

<h3 id="build-a-linux-bpf-program">Build a Linux Bpf program</h3>

<p>In the new version, we started to support the compilation of bpf programs, as well as linux and android platforms, and can automatically pull the llvm and android ndk toolchains.</p>

<p>For more details, please see: <a href="https://github.com/xmake-io/xmake/issues/1274">#1274</a></p>

<p>The build configuration is as follows, it’s very simple.</p>

<p>If we do not need to build the android version, we can remove some configuration about android.</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">add_rules</span><span class="p">(</span><span class="s2">"mode.release"</span><span class="p">,</span> <span class="s2">"mode.debug"</span><span class="p">)</span>
<span class="n">add_rules</span><span class="p">(</span><span class="s2">"platform.linux.bpf"</span><span class="p">)</span>

<span class="n">add_requires</span><span class="p">(</span><span class="s2">"linux-tools"</span><span class="p">,</span> <span class="p">{</span><span class="n">configs</span> <span class="o">=</span> <span class="p">{</span><span class="n">bpftool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">}})</span>
<span class="n">add_requires</span><span class="p">(</span><span class="s2">"libbpf"</span><span class="p">)</span>
<span class="k">if</span> <span class="n">is_plat</span><span class="p">(</span><span class="s2">"android"</span><span class="p">)</span> <span class="k">then</span>
    <span class="n">add_requires</span><span class="p">(</span><span class="s2">"ndk &gt;=22.x"</span><span class="p">)</span>
    <span class="n">set_toolchains</span><span class="p">(</span><span class="s2">"@ndk"</span><span class="p">,</span> <span class="p">{</span><span class="n">sdkver</span> <span class="o">=</span> <span class="s2">"23"</span><span class="p">})</span>
<span class="k">else</span>
    <span class="n">add_requires</span><span class="p">(</span><span class="s2">"llvm &gt;=10.x"</span><span class="p">)</span>
    <span class="n">set_toolchains</span><span class="p">(</span><span class="s2">"@llvm"</span><span class="p">)</span>
    <span class="n">add_requires</span><span class="p">(</span><span class="s2">"linux-headers"</span><span class="p">)</span>
<span class="k">end</span>

<span class="n">target</span><span class="p">(</span><span class="s2">"minimal"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.c"</span><span class="p">)</span>
    <span class="n">add_packages</span><span class="p">(</span><span class="s2">"linux-tools"</span><span class="p">,</span> <span class="s2">"linux-headers"</span><span class="p">,</span> <span class="s2">"libbpf"</span><span class="p">)</span>
    <span class="n">set_license</span><span class="p">(</span><span class="s2">"GPL-2.0"</span><span class="p">)</span>
</code></pre>
</div>

<p>Through the above configuration, we can probably see that we have integrated and configured specific versions of llvm and NDK toolchains,
as well as packages such as libbpf, linux-headers, linux-tools, etc..</p>

<p>xmake will automatically pull them, and then use the corresponding toolchain to integrate and compile these dependent packages, and finally generate the bpf program.</p>

<p>The linux-tools package mainly uses the libtool program inside to generate the bpf skeleton header file, and xmake will automatically run this tool to generate it.</p>

<h4 id="compile-linux-bpf-program">Compile linux bpf program</h4>

<p>We only need to execute the xmake command to complete the compilation, even if you have not installed llvm/clang.</p>

<p>Of course, if you have already installed them, if it’s version is matched, xmake will also be used first.</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake
</code></pre>
</div>

<p>We can also use <code class="highlighter-rouge">xmake -v</code> to compile and view the complete and detailed compilation commands:</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake -v
<span class="o">[</span>20%]: compiling.bpf src/minimal.bpf.c
/usr/bin/ccache /usr/bin/clang -c -Qunused-arguments -m64 -fvisibility<span class="o">=</span>hidden -O3 -Ibuild/.gens/minimal/linux/x86_64/release/rules/bpf -isystem /home/ruki/ .xmake/packages/l/linux-tools/5.9.16/0c52e491268946fe9a4bc91d4906d66b/include -isystem /home/ruki/.xmake/packages/z/zlib/1.2.11/3a7e4427eda94fc69fad0009a1629fd8/include -isystem /home/ruki/.xmake /packages/l/libelf/0.8.13/ced4fdd8151a475dafc5f51e2a031997/include -isystem /home/ruki/.xmake/packages/l/libelf/0.8.13/ced4fdd8151a475dafc5f51e2a031997/include/libelf -isystem /home/ruki/.xmake /l/libcap/2.27/c55b28aa3b3745489b93895d0d606ed1/include -isystem /home/ruki/.xmake/packages/l/linux-headers/5.9.16/8e3a440cbe1f42249aef3d89f1528ecb/include -DNDEBUG -target bpf -g -o build/.gens/.gens /linux/x86_64/release/rules/bpf/minimal.bpf.o src/minimal.bpf.c
llvm-strip -g build/.gens/minimal/linux/x86_64/release/rules/bpf/minimal.bpf.o
bpftool gen skeleton build/.gens/minimal/linux/x86_64/release/rules/bpf/minimal.bpf.o
<span class="o">[</span>40%]: ccache compiling.release src/minimal.c
/usr/bin/ccache /usr/bin/clang -c -Qunused-arguments -m64 -fvisibility<span class="o">=</span>hidden -O3 -Ibuild/.gens/minimal/linux/x86_64/release/rules/bpf -isystem /home/ruki/ .xmake/packages/l/linux-tools/5.9.16/0c52e491268946fe9a4bc91d4906d66b/include -isystem /home/ruki/.xmake/packages/z/zlib/1.2.11/3a7e4427eda94fc69fad0009a1629fd8/include -isystem /home/ruki/.xmake /packages/l/libelf/0.8.13/ced4fdd8151a475dafc5f51e2a031997/include -isystem /home/ruki/.xmake/packages/l/libelf/0.8.13/ced4fdd8151a475dafc5f51e2a031997/include/libelf -isystem /home/ruki/.xmake /l/libcap/2.27/c55b28aa3b3745489b93895d0d606ed1/include -isystem /home/ruki/.xmake/packages/l/linux-headers/5.9.16/8e3a440cbe1f42249aef3d89f1528ecb/include -DNDEBUG -o build/.objs/minimal/linux/x86_64/ release/src/minimal.co src/minimal.c
<span class="o">[</span>60%]: linking.release minimal
/usr/bin/clang++ -o build/linux/x86_64/release/minimal build/.objs/minimal/linux/x86_64/release/src/minimal.co -m64 -L/home/ruki/.xmake/packages/l /linux-tools/5.9.16/0c52e491268946fe9a4bc91d4906d66b/lib64 -L/home/ruki/.xmake/packages/z/zlib/1.2.11/3a7e4427eda94fc69fad0009a1629fd8/lib -L/home/ruki/.xmake/packages/l/libelf /0.8.13/ced4fdd8151a475dafc5f51e2a031997/lib -L/home/ruki/.xmake/packages/l/libcap/2.27/c55b28aa3b3745489b93895d0d606ed1/lib -s -lbpf -lz -lelf -lcap
<span class="o">[</span>100%]: build ok!
</code></pre>
</div>

<h4 id="compile-android-bpf-program">Compile Android bpf program</h4>

<p>If we compile the Android version, we only need to switch to the android platform, which is also very convenient</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake f -p android
<span class="gp">$ </span>xmake
</code></pre>
</div>

<p>xmake will automatically download the ndk tool chain and the corresponding android version libbpf and other libraries to use.</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake f -p android -c
checking <span class="k">for </span>architecture ... armeabi-v7a
checking <span class="k">for </span>Android SDK directory ... no
checking <span class="k">for </span>NDK directory ... no
note: try installing these packages <span class="o">(</span>pass -y to skip confirm<span class="o">)</span>?
<span class="k">in </span><span class="nb">local</span>-repo:
  -&gt; libcap 2.27 <span class="o">[</span>linux, x86_64, from:linux-tools]
  -&gt; libelf 0.8.13 <span class="o">[</span>linux, x86_64, from:linux-tools]
  -&gt; zlib 1.2.11 <span class="o">[</span>linux, x86_64, from:linux-tools]
  -&gt; linux-tools 5.9.16 <span class="o">[</span>bpftool:y]
  -&gt; ndk 22.0
  -&gt; libelf#1 0.8.13 <span class="o">[</span>toolchains:@ndk, from:libbpf]
  -&gt; zlib#1 1.2.11 <span class="o">[</span>toolchains:@ndk, from:libbpf]
  -&gt; libbpf v0.3 <span class="o">[</span>toolchains:@ndk]
please input: y <span class="o">(</span>y/n<span class="o">)</span>

  <span class="o">=</span>&gt; install libcap 2.27 .. ok
  <span class="o">=</span>&gt; install zlib 1.2.11 .. ok
  <span class="o">=</span>&gt; install libelf 0.8.13 .. ok
  <span class="o">=</span>&gt; install ndk 22.0 .. ok
  <span class="o">=</span>&gt; install linux-tools 5.9.16 .. ok
  <span class="o">=</span>&gt; install libelf#1 0.8.13 .. ok
  <span class="o">=</span>&gt; install zlib#1 1.2.11 .. ok
  <span class="o">=</span>&gt; install libbpf v0.3 .. ok
<span class="gp">ruki@010689392c4d:/mnt/bpf_minimal$ </span>xmake
<span class="o">[</span>20%]: compiling.bpf src/minimal.bpf.c
<span class="o">[</span>40%]: ccache compiling.release src/minimal.c
<span class="o">[</span>60%]: linking.release minimal
<span class="o">[</span>100%]: build ok!
</code></pre>
</div>

<p>Of course, if you have manually downloaded the corresponding version of the ndk toolchain, we can also specify it to use it instead of automatically pulling it.</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake f -p android --ndk<span class="o">=</span>/xxx/android-ndk-r22
<span class="gp">$ </span>xmake
</code></pre>
</div>

<p>However, if you download it yourself, remember to download at least the version above ndk r22, because clang in the lower version of ndk does not support the compilation and generation of bpf programs.</p>

<p>Finally, here is a complete bpf scaffolding project based on xmake, you can refer to: <a href="https://github.com/hack0z/libbpf-bootstrap">https://github.com/hack0z/libbpf-bootstrap</a></p>

<p>In addition, there is also a minimal bpf example program: https://github.com/xmake-io/xmake/tree/master/tests/projects/bpf/minimal</p>

<h3 id="integrate-and-use-conda-package">Integrate and use Conda package</h3>

<p>Conda is a very powerful third-party package manager that supports binary package pull in various languages. Here we only use the C/C++ package inside.</p>

<p>Its integrated usage is similar to conan/vcpkg, except that the package namespace is changed to <code class="highlighter-rouge">conda::</code></p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">add_requires</span><span class="p">(</span><span class="s2">"conda::libpng 1.6.37"</span><span class="p">,</span> <span class="p">{</span><span class="n">alias</span> <span class="o">=</span> <span class="s2">"libpng"</span><span class="p">})</span>
<span class="n">add_requires</span><span class="p">(</span><span class="s2">"conda::openssl"</span><span class="p">)</span>
<span class="n">target</span><span class="p">(</span><span class="s2">"testco"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.cpp"</span><span class="p">)</span>
    <span class="n">add_packages</span><span class="p">(</span><span class="s2">"libpng"</span><span class="p">,</span> <span class="s2">"conda::openssl"</span><span class="p">)</span>
</code></pre>
</div>

<p>Note: Although we support many third-party package managers, such as conan/conda/vcpkg/brew, etc., xmake also has its own package repository management.</p>

<p>There are currently nearly 300 commonly used packages that support different platforms, some of which are The package also supports android/ios/mingw and even cross-compilation environment.</p>

<p>Therefore, if the official <a href="https://github.com/xmake-io/xmake-repo">xmake-repo</a> repository already provides the required package, you can use it directly without specifying the package namespace.</p>

<h3 id="get-host-cpu-information">Get host cpu information</h3>

<p>In the current version, we have added a new <code class="highlighter-rouge">core.base.cpu</code> module and <code class="highlighter-rouge">os.cpuinfo</code> interface to obtain various information about the cpu, such as: cpu family/model, microarchitecture, core number, features and other information.</p>

<p>This is usually very useful in projects that pursue performance. These projects usually need to be optimized according to the CPU’s memory model and extended instruction set. At the same time, if you want to cross-platform, you need to specify the corresponding code according to the current cpu information, (for example, after intel haswell) One set, one set after amd zen, the older ones default to no optimization). This information is also used in many high-performance computing libraries.</p>

<p>Therefore, through this module interface, you can obtain the current host cpu information and feature support when compiling and configuring, so as to enable relevant optimized compilation.</p>

<p>We can quickly obtain all information through <code class="highlighter-rouge">os.cpuinfo()</code>, or specify <code class="highlighter-rouge">os.cpuinfo("march")</code> to obtain specific information, such as march, which is microarchitecture</p>

<p>We can also use the <code class="highlighter-rouge">xmake l</code> command to quickly view the obtained results.</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake l os.cpuinfo
<span class="o">{</span>
  features <span class="o">=</span> <span class="s2">"fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clfsh ds acpi mmx fxsr sse sse2 ss htt tm pbe sse3 pclmulqdq dtes64 mon dscpl vmx tse64 mon dscpl vmx tse tm2 s
sse4_1 sse4_2 x2apic movbe popcnt aes pcid xsave osxsave seglim64 tsctmr avx1_0 rdrand f16c"</span>,
  vendor <span class="o">=</span> <span class="s2">"GenuineIntel"</span>,
  model_name <span class="o">=</span> <span class="s2">"Intel(R) Core(TM) i7-8569U CPU @ 2.80GHz"</span>,
  family <span class="o">=</span> 6,
  march <span class="o">=</span> <span class="s2">"Kaby Lake"</span>,
  model <span class="o">=</span> 142,
  ncpu <span class="o">=</span> 8
<span class="o">}</span>

<span class="gp">$ </span>xmake l os.cpuinfo march
<span class="s2">"Kaby Lake"</span>

<span class="gp">$ </span>xmake l os.cpuinfo ncpu
8
</code></pre>
</div>

<p>If you want to determine the support of extended features such as <code class="highlighter-rouge">sse</code>, you need to import the <code class="highlighter-rouge">core.base.cpu</code> module to get it.</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.c"</span><span class="p">)</span>
    <span class="n">on_load</span><span class="p">(</span><span class="k">function</span> <span class="p">(</span><span class="n">target</span><span class="p">)</span>
        <span class="n">import</span><span class="p">(</span><span class="s2">"core.base.cpu"</span><span class="p">)</span>
        <span class="kd">local</span> <span class="n">ncpu</span> <span class="o">=</span> <span class="n">os</span><span class="p">.</span><span class="n">cpuinfo</span><span class="p">(</span><span class="s2">"ncpu"</span><span class="p">)</span>
        <span class="o">-</span> <span class="kd">local</span> <span class="n">ncpu</span> <span class="o">=</span> <span class="n">cpu</span><span class="p">.</span><span class="n">number</span><span class="p">()</span>
        <span class="k">if</span> <span class="n">cpu</span><span class="p">.</span><span class="n">has_feature</span><span class="p">(</span><span class="s2">"sse"</span><span class="p">)</span> <span class="k">then</span>
            <span class="n">target</span><span class="p">:</span><span class="n">add</span><span class="p">(</span><span class="s2">"defines"</span><span class="p">,</span> <span class="s2">"HAS_SSE"</span><span class="p">)</span>
        <span class="k">end</span>
    <span class="k">end</span><span class="p">)</span>
</code></pre>
</div>

<h3 id="added-cmake-import-file-rules">Added cmake import file rules</h3>

<p>If we are developing a library program, after executing <code class="highlighter-rouge">xmake install</code> to install to the system, only the library file is installed, and there is no import file information such as .cmake/.pc, so the cmake project wants to be integrated and used through find_package, usually by looking for Not in our library.</p>

<p>In order to allow the third-party cmake project to find it normally and use the integration, then we can use the <code class="highlighter-rouge">utils.install.cmake_importfiles</code> rule to export the .cmake file when installing the target target library file for the library import and search of other cmake projects .</p>

<p>We only need to apply this rule to the specified target library target through the <code class="highlighter-rouge">add_rules</code> interface.</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.c"</span><span class="p">)</span>
    <span class="n">add_rules</span><span class="p">(</span><span class="s2">"utils.install.cmake_importfiles"</span><span class="p">)</span>
</code></pre>
</div>

<p>After configuration, the <code class="highlighter-rouge">xmake install</code> installation command can automatically export the .cmake import file.</p>

<h3 id="added-pkgconfig-import-file-rules">Added pkgconfig import file rules</h3>

<p>Similar to the <code class="highlighter-rouge">cmake_importfiles</code> above, but we can also install the pkgconfig/.pc import file through the <code class="highlighter-rouge">utils.install.pkgconfig_importfiles</code> rule, which is very useful for library detection by tools such as autotools.</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.c"</span><span class="p">)</span>
    <span class="n">add_rules</span><span class="p">(</span><span class="s2">"utils.install.pkgconfig_importfiles"</span><span class="p">)</span>
</code></pre>
</div>

<h3 id="added-git-related-built-in-configuration-variables">Added Git related built-in configuration variables</h3>

<p>xmake has always provided the automatic generation feature of config.h, which can be configured through the <a href="https://xmake.io/#/manual/project_target?id=targetadd_configfiles">add_configfiles</a> interface, and it also supports the replacement of template variables. You can define some variables yourself.</p>

<p>However, xmake also provides some commonly used built-in variable substitutions, such as version information, platform architecture, etc. For details, see: <a href="https://xmake.io/#/manual/project_target?id=targetadd_configfiles">https://xmake.io/#/manual/project_target?id=targetadd_configfiles</a></p>

<p>The template configuration is very simple, just need:</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.c"</span><span class="p">)</span>
    <span class="n">add_configfiles</span><span class="p">(</span><span class="s2">"src/config.h.in"</span><span class="p">)</span>
</code></pre>
</div>

<p>The config.h file can be automatically generated according to config.h.in.</p>

<p>But the new feature we are going to talk about here is the newly provided Git-related built-in variables to allow users to quickly and conveniently compile the project or the latest tag/branch/commit information of the current git project.</p>

<p>This is very useful for troubleshooting and locating problems in the later stage.</p>

<p>We can use commit to pinpoint the problem library based on which commit submission caused the problem. In this way, we can checkout but the corresponding version to troubleshoot the problem.</p>

<p>We only need to configure and define the following variables in config.h.in.</p>

<div class="language-c highlighter-rouge"><pre class="highlight"><code><span class="cp">#define GIT_COMMIT "${GIT_COMMIT}"
#define GIT_COMMIT_LONG "${GIT_COMMIT_LONG}"
#define GIT_COMMIT_DATE "${GIT_COMMIT_DATE}"
#define GIT_BRANCH "${GIT_BRANCH}"
#define GIT_TAG "${GIT_TAG}"
#define GIT_TAG_LONG "${GIT_TAG_LONG}"
#define GIT_CUSTOM "${GIT_TAG}-${GIT_COMMIT}"
</span></code></pre>
</div>

<p>Execute xmake to compile, it will automatically generate the following config.h file.</p>

<div class="language-c highlighter-rouge"><pre class="highlight"><code><span class="cp">#define GIT_COMMIT "8c42b2c2"
#define GIT_COMMIT_LONG "8c42b2c251793861eb85ffdf7e7c2307b129c7ae"
#define GIT_COMMIT_DATE "20210121225744"
#define GIT_BRANCH "dev"
#define GIT_TAG "v1.6.6"
#define GIT_TAG_LONG "v1.6.6-0-g8c42b2c2"
#define GIT_CUSTOM "v1.6.6-8c42b2c2"
</span></code></pre>
</div>

<p>We can use them in the program by means of macro definitions.</p>

<h3 id="android-ndk-r22-support-and-remote-pull">Android NDK r22 support and remote pull</h3>

<p>The Android NDK has made very big structural changes since r22, removing some obsolete directories, such as the top-level sysroot directory and platforms directory,
causing the previous detection method of xmake to fail.</p>

<p>Therefore, in the new version, we have made improvements to xmake to better support the full version of the NDK toolchain, including the new version above r22.</p>

<p>At the same time, the official repository of xmae-repo has also added the inclusion of ndk packages, enabling xmake to pull the ndk tool chain remotely for use.</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">add_requires</span><span class="p">(</span><span class="s2">"ndk &gt;=22.x"</span><span class="p">)</span>
<span class="n">set_toolchains</span><span class="p">(</span><span class="s2">"@ndk"</span><span class="p">,</span> <span class="p">{</span><span class="n">sdkver</span> <span class="o">=</span> <span class="s2">"23"</span><span class="p">})</span>
<span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.c"</span><span class="p">)</span>
</code></pre>
</div>

<h2 id="changelog">Changelog</h2>

<h3 id="new-features">New features</h3>

<ul>
  <li><a href="https://github.com/xmake-io/xmake/issues/1259">#1259</a>: Support <code class="highlighter-rouge">add_files("*.def")</code> to export symbols for windows/dll</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1267">#1267</a>: add <code class="highlighter-rouge">find_package("nvtx")</code></li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1274">#1274</a>: add <code class="highlighter-rouge">platform.linux.bpf</code> rule to build linux/bpf program</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1280">#1280</a>: Support fetchonly package to improve find_package</li>
  <li>Support to fetch remote ndk toolchain package</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1268">#1268</a>: Add <code class="highlighter-rouge">utils.install.pkgconfig_importfiles</code> rule to install <code class="highlighter-rouge">*.pc</code> import file</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1268">#1268</a>: Add <code class="highlighter-rouge">utils.install.cmake_importfiles</code> rule to install <code class="highlighter-rouge">*.cmake</code> import files</li>
  <li><a href="https://github.com/xmake-io/xmake-repo/pull/348">#348</a>: Add <code class="highlighter-rouge">platform.longpaths</code> policy to support git longpaths</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1314">#1314</a>: Support to install and use conda packages</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1120">#1120</a>: Add <code class="highlighter-rouge">core.base.cpu</code> module and improve <code class="highlighter-rouge">os.cpuinfo()</code></li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1325">#1325</a>: Add builtin git variables for <code class="highlighter-rouge">add_configfiles</code></li>
</ul>

<h3 id="change">Change</h3>

<ul>
  <li><a href="https://github.com/xmake-io/xmake/issues/1275">#1275</a>: Support conditionnal targets for vsxmake plugin</li>
  <li><a href="https://github.com/xmake-io/xmake/pull/1290">#1290</a>: Improve android ndk to support &gt;= r22</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1311">#1311</a>: Add packages lib folder to PATH for vsxmake project</li>
</ul>

<h3 id="bugs-fixed">Bugs fixed</h3>

<ul>
  <li><a href="https://github.com/xmake-io/xmake/issues/1266">#1266</a>: Fix relative repo path in <code class="highlighter-rouge">add_repositories</code></li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1288">#1288</a>: Fix vsxmake generator with option configs</li>
</ul>


        </article>
        <hr>

        <!-- baidu ads -->
        

        
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
                    
                    <h2 id="chinese">中文</h2>
                    <ul>
                    
                    <li class="relatedPost">
                        <a href="/cn/2021/04/08/xmake-update-v2.5.3/">xmake v2.5.3 发布，支持构建 linux bpf 程序和 Conda 包集成
                        
                        </a>
                    </li>
                    
                    
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
        
            </ul>
        

        
        
            
            
            
                
                    
                        
                        <h2 id="similar_posts">Similar Posts</h2>
                        <ul>
                        
                        <li class="relatedPost">
                            <a href="/2021/12/17/xmake-update-v2.6.2/">Xmake v2.6.2 released, Support building Linux kernel driver module
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/2021/12/03/xmake-update-v2.6.1/">xmake v2.6.1 released, Switch to Lua5.4 runtime, Support Rust and C++ mixed compilation
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/2021/10/30/xmake-update-v2.5.9/">xmake v2.5.9 released, Improve C++20 Modules and support Nim, Keil MDK and Unity Build
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/2021/10/08/xmake-update-v2.5.8/">xmake v2.5.8 is released, Support Pascal/Swig program and Lua53 runtime
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/2021/08/29/xmake-update-v2.5.7/">xmake v2.5.7 released, Use lockfile to freeze package dependencies and Vala/Metal language support
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
        
            </ul>
        

        <div class="post-recent">
    <div class="pre">

        

        

        
        
        

        

        

        
        
        <p><strong>Prev Post</strong> <a href="/2021/02/27/xmake-update-v2.5.2/">xmake v2.5.2 released, Support pull remote cross-toolchain and package integration</a></p>
        
    </div>

    <div class="nex">

        

        

        
        
        

        

        

        
        
        

        

        

        
        
        <p><strong>Next Post</strong> <a href="/2021/05/03/please-use-xmake/">C/C++ build system, I use xmake</a></p>
        
    </div>
</div>


        <h2 id="comments">Comments</h2>
        






<div id="gitalk-container"></div>
<link rel="stylesheet" href="/css/gitalk.css">
<script src="/js/gitalk.min.js"></script>

<script>
const gitalk = new Gitalk({
  clientID: '73946dc1d9e2276ad0da',
  clientSecret: '12a3cb94361ba3ebc6ecb68cf80d592bfaa8106d',
  repo: 'tboox.github.io',
  owner: 'waruqi',
  admin: ['waruqi'],
  id: location.pathname,      
  language: 'en',
  distractionFreeMode: false  
})

gitalk.render('gitalk-container')
</script>





    </div>
    <button class="anchor"><i class="fa fa-anchor"></i></button>
    <div class="right">
        <div class="wrap">


            <!-- codefund ads -->
            

            <!-- Content -->
            <div class="side content">
                <div>
                    Content
                </div>
                <ul id="content-side" class="content-ul">
                    <li><a href="#chinese">中文</a></li>
                    <li><a href="#similar_posts">Similar Posts</a></li>
                    <li><a href="#comments">Comments</a></li>
                </ul>
            </div>

            <!-- baidu ads -->
            

            <br>
            <div class="side">
                <div>
                    <i class="fa fa-external-link"></i>
                    Links
                </div>
                <ul class="content-ul">
                  <li><a href="http://github.com/waruqi/tbox">tbox</a></li>
                  <li><a href="http://www.xmake.io">xmake</a></li>
                  <li><a href="https://github.com/waruqi">github</a></li>
                </ul>
            </div> 

            <!-- google ads -->
            

            <!-- baidu ads -->
            

            <!-- chitika ads -->
            
        </div>
    </div>

    <!-- baidu ads -->
    
</div>
<script>
/**
 * target _blank
 */
(function() {
    var aTags = document.querySelectorAll('article a:not([id])')
    for (var i = 0; i < aTags.length; i++) {
        aTags[i].setAttribute('target', '_blank')
    }
}());
</script>
<script src="/js/pageContent.js " charset="utf-8"></script>



    <footer class="site-footer">
    <div class="wrapper">
        <p class="description">
             Copyright (c) 2016-2020 tboox.org 
        </p>
        <p class="contact">
            
            <a href="https://github.com/waruqi" title="GitHub"><i class="fa fa-github" aria-hidden="true"></i></a> 
             
            
            <a href="mailto:waruqi@gmail.com" title="email"><i class="fa fa-envelope-o" aria-hidden="true"></i></a> 
            
            
            <a href="https://twitter.com/waruqi" title="Twitter"><i class="fa fa-twitter" aria-hidden="true"></i></a> 
            
            <a href="/feed.xml" title="feed"><i class="fa fa-feed" aria-hidden="true"></i></a> 
        </p>
        <p class="power">
            <span>
                Site powered by <a href="https://jekyllrb.com/">Jekyll</a> & <a href="https://github.com/Gaohaoyang">HyG</a> & <a href="https://pages.github.com/">Github Pages</a>.
            </span>
        </p>
    </div>
</footer>

    <div class="back-to-top">
    <a href="#top" class="scroll">
        <i class="fa fa-arrow-up" aria-hidden="true"></i>
    </a>
</div>

    <script src=" /js/main.js " charset="utf-8"></script>
    <script src=" /js/scroll.min.js " charset="utf-8"></script>
  </body>

</html>
